//
//  MainViewController.m
//  CommodityManager
//
//  Created by lanou3g on 15/5/28.
//  Copyright (c) 2015年 libertyair. All rights reserved.
//

#import "MainViewController.h"
#import "CommodityTableViewController.h"
#import "PurchaseHistoryTableViewController.h"
#import "CustomerViewController.h"
#import "SaleViewController.h"
#import "SupplyBusinessViewController.h"
@interface MainViewController ()

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    //设置圆角
    self.commodity.layer.cornerRadius=30;
    self.customer.layer.cornerRadius=30;
    self.suppliers.layer.cornerRadius=30;
    self.purchase.layer.cornerRadius=30;
    self.market.layer.cornerRadius=30;
    self.statistics.layer.cornerRadius=30;
    //设置背景图片
    self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"backGround"]];
    //在navigationBar上设置搜索框
   UISearchBar *searchBar = [[UISearchBar alloc]initWithFrame:CGRectMake(85,0.0,200,44)];
    searchBar.delegate = self;
    [searchBar setPlaceholder:@"搜索"];
    self.navigationItem.titleView=searchBar;
    
   
}

//回收searchBar键盘
-(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
    [searchBar resignFirstResponder];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//推出商品管理页面
- (IBAction)enterCommodityView:(id)sender {
    
    CommodityTableViewController*commodityTVC=[[CommodityTableViewController alloc] initWithNibName:nil bundle:[NSBundle mainBundle]];
    [self.navigationController pushViewController:commodityTVC animated:YES];
    
}
//推出采购页面
- (IBAction)enterPurchaseView:(id)sender {
    
    PurchaseHistoryTableViewController*purchaseTVC=[[PurchaseHistoryTableViewController alloc] initWithNibName:nil bundle:[NSBundle mainBundle]];
    [self.navigationController pushViewController:purchaseTVC animated:YES];
}

//推出客户管理页面
- (IBAction)enterCustomView:(id)sender {
    
    CustomerViewController*customerVC=[[CustomerViewController alloc] initWithNibName:nil bundle:[NSBundle mainBundle]];
    [self.navigationController pushViewController:customerVC animated:YES];
    
    
}

//推出供应商管理页面


- (IBAction)enterBusinessView:(id)sender {
    
    
    SupplyBusinessViewController*supplyVC=[[SupplyBusinessViewController alloc] initWithNibName:nil bundle:[NSBundle mainBundle]];
    [self.navigationController pushViewController:supplyVC animated:YES];
    
    
    
}

//推出销售页面


- (IBAction)enterSaleView:(id)sender {
    
    SaleViewController*saleVC=[[SaleViewController alloc] initWithNibName:nil bundle:[NSBundle mainBundle]];
    [self.navigationController pushViewController:saleVC animated:YES];
    
    
    
}




/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
